package componentes;

import java.awt.Component;

import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableRowSorter;

public class tablemodel extends AbstractTableModel implements TableCellRenderer {

	
	public Component getTableCellRendererComponent(JTable table, Object value,
			 boolean isSelected,
			 boolean hasFocus,
			 int row, int column) {
		
			if (column == this.){
				return new JButton("Buy");
		}
	}
	
private String[] columnNames = {"First Name",
            "Last Name",
            "Sport",
            "# of Years",
            "Vegetarian"};

private Object[][] data = {
{"Kathy", "Smith",
"Snowboarding",new JButton("Button One"), new Boolean(false)},
{"John", "Doe",
"Rowing", new JButton("Button dos"), new Boolean(true)},
{"Sue", "Black",
"Knitting", new Integer(2), new Boolean(false)},
{"Jane", "White",
"Speed reading", new Integer(20), new Boolean(true)},
{"Joe", "Brown",
"Pool", new Integer(10), new Boolean(false)}
};

private TableCellRenderer __defaultRenderer;





public int getColumnCount() {
    return columnNames.length;
}

public int getRowCount() {
    return data.length;
}

public String getColumnName(int col) {
    return columnNames[col];
}

public Object getValueAt(int row, int col) {
    return data[row][col];
}

public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
}

public boolean isCellEditable(int row, int col) {
        return false;
}



	
	
	
	
	
	
	

}
